package com.yang.designmode.composite;

public class Client {
    public static void main(String[] args) {
        // 创建叶子节点
        Component leaf1 = new Leaf("Leaf1");
        Component leaf2 = new Leaf("Leaf2");

        // 创建组合节点
        Composite composite = new Composite("Composite1");
        composite.add(leaf1);
        composite.add(leaf2);

        // 调用组合的操作
        composite.operation();
    }
}

